<pre class="docs-method-signature"><code>path.length([opt])</code></pre>
<p>Return the length of the path.</p>

<p>The path length is a sum of the lengths of visible path segments; invisible segments (e.g. Moveto segments) have a length of 0. If the path has no segments at all, <code>0</code> is returned.</p>

<p>Although calculating the length of linear segments (e.g. Lineto and Closepath segments) is straightforward, determining the length of curved segments is complex. Refer to <code>curve.length()</code> <a href="#g.Curve.prototype.length">documentation</a> for more information.</p>

<p>The <code>opt</code> argument is optional. Two properties may be specified, <code>opt.precision</code> and <code>opt.segmentSubdivisions</code>, which determine maximum error allowed for the length calculation (default precision is 3; this corresponds to maximum observed error of 0.1%). The <code>opt.segmentSubdivisions</code> property is an array of individual segments' <a href="#g.Curve.prototype.getSubdivisions">subdivision arrays</a>. The <code>path.getSegmentSubdivisions()</code> <a href="#g.Path.prototype.getSegmentSubdivisions">function</a> may be used to obtain the <code>segmentSubdivisions</code> array.</p>
